// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import Axios from 'axios'
import { Lazyload,ImagePreview,Field,Cell,CellGroup,List,Sticky,Tab,Tabs,Icon,Swipe, SwipeItem,Divider,Row, Col,GoodsAction,
  GoodsActionIcon,
  GoodsActionButton,
  Toast
} from 'vant'
import './assets/base.css'
Vue.use(Lazyload).use(ImagePreview).use(Field).use(Cell).use(CellGroup).use(List).use(Sticky).use(Tab).use(Tabs).use(Icon).use(Swipe).use(SwipeItem).use(Divider).use(Row).use(Col).use(GoodsAction)
  .use(GoodsActionIcon).use(GoodsActionButton).use(Toast);
//注册事件总线
Vue.prototype.$event = new Vue({
    data(){
      return {
        topTitle:'首页',
        haveLeft:false,
        leftText:'',
      }
    }
});

Vue.filter('hiddenWorld',function(value,n){
    var num = value.length
    if (num < n) {
        return value
    } else {
      return value.substr(0,n)+'...'
    }
})

//配置axios
Axios.defaults.baseURL = 'http://yapi.demo.qunar.com/mock/31214/test/'
Vue.prototype.$axios = Axios


Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
